#include "appsettingsstrorage.h"

const QString paramNameHost = "host";
const QString paramNameLogin = "login";
const QString paramNamePassword = "password";

const QString defValHost = "192.168.2.131";
const QString defValLogin = "admin";
const QString defValPassword = "qweQWE123";

AppSettingsStrorageByQSettings::AppSettingsStrorageByQSettings(QObject *parent) :
	AbstractAppSettingsStorage(parent)
{
}

QString AppSettingsStrorageByQSettings::host(){
	return mSettings.value(paramNameHost, defValHost).toString();
}

void AppSettingsStrorageByQSettings::saveHost(const QString &host){
	mSettings.setValue(paramNameHost, host);
}

QString AppSettingsStrorageByQSettings::login(){
	return mSettings.value(paramNameLogin, defValLogin).toString();
}

void AppSettingsStrorageByQSettings::saveLogin(const QString &login){
	mSettings.setValue(paramNameLogin, login);
}

QString AppSettingsStrorageByQSettings::password(){
	return mSettings.value(paramNamePassword, defValPassword).toString();
}

void AppSettingsStrorageByQSettings::savePassword(const QString &password){
	mSettings.setValue(paramNamePassword, password);
}
